package com.cn.qtms.controller;//类注释设置模板

import com.cn.qtms.base.controller.BaseController;
import com.cn.qtms.base.service.BaseService;
import com.cn.qtms.entity.TsAttachment;
import com.cn.qtms.service.TsAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @Name:TsAttachMentController
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-09-20 16:14
 **/
@RestController
@RequestMapping("attachMent")
public class TsAttachMentController extends BaseController<TsAttachment,Long> {
    @Autowired
    private TsAttachmentService service;
    @Override
    protected BaseService<TsAttachment, Long> getService() {
        return service;
    }

    @PostMapping(value="feign-deleteAttachMent")
    public TsAttachment deleteAttachMent(@RequestBody HashMap<String,String> map){
        String path = map.get("url");
        return service.deleteAttachMent(path);
    }
}
